package com.gc.server.service;

import com.gc.server.entity.CostApplyEntity;
import com.gc.server.vo.CostApplyVo;
import com.yf.service.BaseService;
import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 费用申请Service接口
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Wed Oct 21 17:34:54 CST 2020
 */
public interface CostApplyService extends BaseService<CostApplyEntity> {

    /************自动生成**************/
    List<CostApplyVo> findVo(CostApplyVo vo);

        CostApplyVo getVo(Long id);

     int updateVo(CostApplyVo vo);

       int saveVo(CostApplyVo vo);

    void downLoad(HttpServletResponse response, List<CostApplyVo> list);

    /***********BACK***********/




    /***********API***********/

    CostApplyEntity apply(Long userId,Integer type,BigDecimal amount,String bankInfo,String remark,String img,String title,String unit,String payWay,Date payTime,Long busId,Long id,BigDecimal carMoney,BigDecimal houseMoney,BigDecimal otherMoney,BigDecimal moreMoney);

    CostApplyEntity check(Long userId, Long applyId,Integer status,String remark);

    List<CostApplyVo> findByUser(@Param("userId") Long userId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);


    List<CostApplyVo> findByPid(Long userId);

    List<CostApplyVo> findByPidAndDate( Long userId,Date startDate, Date endDate);

    BigDecimal sumAmount(Date date,Long userId);

    BigDecimal sumAmountByTop(Date date,Long userId);

    int sumCheck(Long userId);

    CostApplyEntity findByBusId(Long id);


    void draw(HttpServletResponse response, Long id);
}
